home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / uupc11ys.zip / UUCP / UUCP.C next >
C/C++ Source or Header  |  1993-04-10  |  26KB  |  631 lines

  1. /*--------------------------------------------------------------------*/
  2. /*    u u c p . c                                                     */
  3. /*                                                                    */
  4. /*    UUCP lookalike for IBM PC.                                      */
  5. /*--------------------------------------------------------------------*/
  6.  
  7. /*--------------------------------------------------------------------*/
  8. /*    Changes Copyright (c) 1990-1993 by Kendra Electronic            */
  9. /*    Wonderworks.                                                    */
  10. /*                                                                    */
  11. /*    All rights reserved except those explicitly granted by the      */
  12. /*    UUPC/extended license agreement.                                */
  13. /*--------------------------------------------------------------------*/
  14.  
  15. /*--------------------------------------------------------------------*/
  16. /*                          RCS Information                           */
  17. /*--------------------------------------------------------------------*/
  18.  
  19. /*
  20.  *    $Id: UUCP.C 1.4 1993/04/11 00:35:46 ahd Exp $
  21.  *
  22.  *    Revision history:
  23.  *    $Log: UUCP.C $
  24.  * Revision 1.4  1993/04/11  00:35:46  ahd
  25.  * Global edits for year, TEXT, etc.
  26.  *
  27.  * Revision 1.3  1993/04/05  04:35:40  ahd
  28.  * Use timestamp/file size information returned by directory search
  29.  *
  30.  * Revision 1.2  1992/12/11  12:45:11  ahd
  31.  * Normalize paths for files read
  32.  *
  33.  */
  34.  
  35. /*--------------------------------------------------------------------*/
  36. /*                                                                    */
  37. /*    Change history:                                                 */
  38. /*                                                                    */
  39. /*       02/08/81 H.A.E.Broomhall                                     */
  40. /*                Hacked for UUPC/extended 1.09c                      */
  41. /*       04/27/91 Drew Derbyshire                                     */
  42. /*                Modified for UUPC/extended 1.10a                    */
  43. /*       09/26/91 Mitch Mitchell                                      */
  44. /*                Support for UUX                                     */
  45. /*       01/26/92 Drew Derbyshire                                     */
  46. /*                Various comment and error message clean up          */
  47. /*--------------------------------------------------------------------*/
  48.  
  49. /*--------------------------------------------------------------------*/
  50. /*                        system include files                        */
  51. /*--------------------------------------------------------------------*/
  52.  
  53. #include  <ctype.h>
  54. #include  <direct.h>
  55. #include  <fcntl.h>
  56. #include  <io.h>
  57. #include  <stdio.h>
  58. #include  <stdlib.h>
  59. #include  <string.h>
  60. #include  <sys/types.h>
  61. #include  <sys/stat.h>
  62.  
  63. /*--------------------------------------------------------------------*/
  64. /*                    UUPC/extended include files                     */
  65. /*--------------------------------------------------------------------*/
  66.  
  67. #include  "lib.h"
  68. #include  "expath.h"
  69. #include  "getopt.h"
  70. #include  "getseq.h"
  71. #include  "hlib.h"
  72. #include  "hostable.h"
  73. #include  "import.h"
  74. #include  "uundir.h"
  75. #include  "security.h"
  76. #include  "timestmp.h"
  77.  
  78. /*--------------------------------------------------------------------*/
  79. /*                          Global variables                          */
  80. /*--------------------------------------------------------------------*/
  81.  
  82. static boolean       spool_flag = FALSE;
  83. static char          spool_file[FILENAME_MAX]; /* alt spool file name */
  84. static boolean       dir_flag = TRUE;
  85. static boolean       xeqt_flag = TRUE;    /* Triggered by -r option */
  86. static char          grade = 'n';         /* Default grade of service */
  87. static boolean       mail_me = FALSE;     /* changes with -m */
  88. static boolean       mail_them = FALSE;   /* changes with -n */
  89. static char  remote_user[10];             /* user to mail with -n */
  90. static char  *destn_file;
  91. static char  flags[16];
  92.  
  93. currentfile();
  94.  
  95. /*--------------------------------------------------------------------*/
  96. /*    u s a g e                                                       */
  97. /*                                                                    */
  98. /*    Report flags used by program                                    */
  99. /*--------------------------------------------------------------------*/
  100.  
  101. static         void    usage(void)
  102. {
  103.       fprintf(stderr, "Usage: uucp\t[-c|-C] [-d|-f] [-gGRADE] [-j] [-m] [-nUSER] [-r] [-sFILE]\\\n\
  104. \t\t[-xDEBUG_LEVEL] source-files destination-file\n");
  105. }
  106.  
  107. /*--------------------------------------------------------------------*/
  108. /*    c p                                                             */
  109. /*                                                                    */
  110. /*    Copy a file                                                     */
  111. /*--------------------------------------------------------------------*/
  112.  
  113. static int cp(char *from, char *to)
  114. {
  115.       int         fd_from, fd_to;
  116.       int         nr, nw = -1;
  117.       char        buf[BUFSIZ*4]; /* faster if we alloc a big buffer */
  118.  
  119.       if ((fd_from = open(from, O_RDONLY | O_BINARY)) == -1)
  120.          return(1);        /* failed */
  121.       /* what if the to is a directory? */
  122.       /* possible with local source & dest uucp */
  123.       if ((fd_to = open(to, O_CREAT | O_BINARY | O_WRONLY, S_IWRITE | S_IREAD)) == -1) {
  124.          close(fd_from);
  125.          return(1);        /* failed */
  126.          /* NOTE - this assumes all the required directories exist!  */
  127.       }
  128.       while  ((nr = read(fd_from, buf, sizeof buf)) > 0 &&
  129.          (nw = write(fd_to, buf, nr)) == nr)
  130.          ;
  131.       close(fd_to);
  132.       close(fd_from);
  133.       if (nr != 0 || nw == -1)
  134.          return(1);        /* failed in copy */
  135.       return(0);
  136. } /* cp */
  137.  
  138. /*--------------------------------------------------------------------*/
  139. /*    s p l i t _ p a t h                                             */
  140. /*                                                                    */
  141. /*    split_path splits a path into 3 components.                     */
  142. /*    1)  The system next in line                                     */
  143. /*    2)  Any intermediate systems as a bang path                     */
  144. /*    3)  The actual file name/path                                   */
  145. /*                                                                    */
  146. /*    It tries to be a little clever with idiots, in recognizing      */
  147. /*    system=this machine                                             */
  148. /*--------------------------------------------------------------------*/
  149.  
  150. static         void    split_path(char *path,
  151.                                   char *system,
  152.                                   char *inter,
  153.                                   char *file)
  154. {
  155.       char    *p_left, *p_right, *p;
  156.  
  157.       *system = *inter = *file = '\0';    /* init to nothing */
  158.       for (p = path;; p = p_left + 1)  {
  159.          p_left = strchr(p, '!');         /* look for the first bang */
  160.          if (p_left == NULL)  {           /* not a remote path */
  161.             strcpy(file, p);              /* so just return filename */
  162.             return;
  163.          }
  164.          /* now check if the system was in fact us.
  165.        If so strip it and restart */
  166.          if (equaln(E_nodename, p, p_left - p) &&
  167.             (E_nodename[p_left - p] == '\0'))
  168.             continue;
  169.  
  170.          p_right = strrchr(p, '!');      /* look for the last bang */
  171.          strcpy(file, p_right + 1);      /* and thats our filename */
  172.          strncpy(system, p, p_left - p); /* and we have a system thats not us */
  173.          system[p_left - p] = '\0';
  174.          /* now see if there is an intermediate path */
  175.          if (p_left != p_right)  {        /* yup - there is */
  176.             strncpy(inter, p_left + 1, p_right - p_left - 1);
  177.             inter[p_right - p_left - 1] = '\0';
  178.          }
  179.          return;                 /* and we're done */
  180.       }        /* never get here :-)  */
  181. }
  182.  
  183. /*--------------------------------------------------------------------*/
  184. /*    d o _ u u x                                                     */
  185. /*                                                                    */
  186. /*    Generate & execute UUX command                                  */
  187. /*--------------------------------------------------------------------*/
  188.  
  189. int   do_uux(char *remote,
  190.              char *src_syst,
  191.              char *src_file,
  192.              char *dest_syst,
  193.              char *dest_inter,
  194.              char *dest_file)
  195. {
  196.       char        xcmd[BUFSIZ];        /* buffer for assembling the UUX command */
  197.       char        *ex_flg;
  198.  
  199. /*--------------------------------------------------------------------*/
  200. /*                 First - lets get the basic command                 */
  201. /*--------------------------------------------------------------------*/
  202.  
  203.       ex_flg = xeqt_flag ? "" : "-r";
  204.       sprintf(xcmd, "uux -C %s %s!uucp -C ", ex_flg, remote);
  205.                               /* but what about mailing the guy? */
  206.  
  207. /*--------------------------------------------------------------------*/
  208. /*                  Now we sort out the source name                   */
  209. /*--------------------------------------------------------------------*/
  210.  
  211.       if ((*src_syst == '\0') || equal(src_syst, E_nodename))
  212.          sprintf(xcmd + strlen(xcmd), " \\!%s ", src_file);
  213.       else  {
  214.          if (!equal(remote, src_syst))
  215.             sprintf(xcmd + strlen(xcmd), " (%s!%s) ", src_syst, src_file);
  216.          else
  217.             sprintf(xcmd + strlen(xcmd), " (%s) ", src_file);
  218.       } /* else */
  219.  
  220. /*--------------------------------------------------------------------*/
  221. /*                   Now to do the destination name                   */
  222. /*--------------------------------------------------------------------*/
  223.  
  224.       if (*dest_inter != '\0')  {
  225.          if (*dest_syst != '\0')
  226.             sprintf(xcmd + strlen(xcmd), " (%s!%s!%s) ", dest_syst, dest_inter, dest_file);
  227.          else
  228.             sprintf(xcmd + strlen(xcmd), " (%s!%s) ", dest_inter, dest_file);
  229.       }
  230.       else  {
  231.          if ((*dest_syst == '\0') || equal(dest_syst, E_nodename))
  232.             sprintf(xcmd + strlen(xcmd), " (%s!%s) ", E_nodename, dest_file);
  233.       }
  234.       printmsg(2, "xcmd: %s", xcmd);
  235.  
  236. /*--------------------------------------------------------------------*/
  237. /*                              OK - GO!                              */
  238. /*--------------------------------------------------------------------*/
  239.  
  240.       system(xcmd);
  241.       return(1);
  242.  
  243. } /* do_uux */
  244.  
  245. /*--------------------------------------------------------------------*/
  246. /*    d o _ c o p y                                                   */
  247. /*                                                                    */
  248. /*    At this point only one of the systems can be remote and only    */
  249. /*    1 hop away.  All the rest have been filtered out                */
  250. /*--------------------------------------------------------------------*/
  251.  
  252. int   do_copy(char *src_syst,
  253.               char *src_file,
  254.               char *dest_syst,
  255.               char *dest_file)
  256. {
  257.       char        *p;
  258.       boolean wild_flag = FALSE;
  259.       boolean write_flag;
  260.       char        tmfile[15];       /* Unix style name for c file */
  261.       char        idfile[15];       /* Unix style name for data file copy */
  262.       char        work[FILENAME_MAX];   /* temp area for filename hacking */
  263.       char        search_file[FILENAME_MAX];
  264.       char        source_path[FILENAME_MAX];
  265.       char        icfilename[FILENAME_MAX]; /* our hacked c file path */
  266.       char        idfilename[FILENAME_MAX]; /* our hacked d file path */
  267.  
  268.       struct  stat    statbuf;
  269.       DIR *dirp = NULL;
  270.       struct direct *dp = NULL;
  271.       char subseq = 'A';
  272.  
  273.       long    int     sequence;
  274.       char    *remote_syst;   /* Non-local system in copy            */
  275.       char    *sequence_s;
  276.       FILE        *cfile;
  277.       static  char    *spool_fmt = SPOOLFMT;
  278.  
  279.       sequence = getseq();
  280.       sequence_s = JobNumber( sequence );
  281.       remote_syst =  equal(src_syst, E_nodename) ? dest_syst : src_syst;
  282.       sprintf(tmfile, spool_fmt, 'C', remote_syst, grade, sequence_s);
  283.       importpath(work, tmfile, remote_syst);
  284.       mkfilename(icfilename, E_spooldir, work);
  285.  
  286.       if (!equal(src_syst, E_nodename))
  287.       {
  288.          if (expand_path(dest_file, NULL, E_homedir, NULL) == NULL)
  289.             exit(1);
  290.          strcpy( dest_file, normalize( dest_file ));
  291.          p  = src_file;
  292.          while (*p)
  293.          {
  294.             if (*p ==  '\\')
  295.                *p = '/';
  296.             p++;
  297.          }
  298.          printmsg(1, "uucp - from \"%s\" - control = %s", src_syst,
  299.                   tmfile);
  300.          if ((cfile = FOPEN(icfilename, "a",TEXT_MODE )) == NULL)  {
  301.             printerr( icfilename );
  302.             fprintf(stderr, "uucp: cannot append to %s\n", icfilename);
  303.             panic();
  304.          }
  305.          fprintf(cfile, "R %s %s %s -%s %s 0777 %s\n", src_file, dest_file,
  306.                E_mailbox, flags, *spool_file ? spool_file : "dummy", remote_user);
  307.          fclose(cfile);
  308.          return(1);
  309.       }
  310.       else if (!equal(dest_syst, E_nodename))  {
  311.          printmsg(1,"uucp - spool %s - mkdir %s - execute %s",
  312.                 spool_flag ? "on" : "off",
  313.                   dir_flag ? "on" : "off", xeqt_flag ? "do" : "don't");
  314.  
  315.          printmsg(1,"     - dest m/c = %s  sequence = %ld  control = %s",
  316.                   dest_syst, sequence, tmfile);
  317.  
  318.          if (expand_path(src_file, NULL, E_homedir, NULL) == NULL)
  319.             exit(1);
  320.          normalize( src_file );
  321.  
  322.          p  = dest_file;
  323.  
  324.          while (*p)
  325.          {
  326.             if (*p ==  '\\')
  327.                *p = '/';
  328.             p++;
  329.          }
  330.  
  331.          if (strcspn(src_file, "*?") == strlen(src_file))
  332.          {
  333.             wild_flag = FALSE;
  334.  
  335.             if (stat(src_file, &statbuf) != 0)
  336.             {
  337.                printerr( src_file );
  338.                exit(1);
  339.             }
  340.  
  341.             if (statbuf.st_mode & S_IFDIR)
  342.             {
  343.                printf("uucp - directory name \"%s\" illegal\n",
  344.                        src_file );
  345.                exit(1);
  346.             }
  347.          } /* if (strcspn(src_file, "*?") == strlen(src_file))  */
  348.          else  {
  349.             wild_flag = TRUE;
  350.             strcpy(source_path, src_file);
  351.             p = strrchr(source_path, '/');
  352.             strcpy(search_file, p+1);
  353.             *++p = '\0';
  354.  
  355.             dirp = opendirx(source_path,search_file);
  356.             if (dirp == NULL)
  357.             {
  358.                printf("uucp - unable to open directory %s\n",source_path);
  359.                exit(1);
  360.             } /* if */
  361.  
  362.             if ((dp = readdir(dirp)) == nil(struct direct))
  363.             {
  364.                printf("uucp - can't find any file %s\n", search_file);
  365.                exit(1);
  366.             }
  367.          } /* else */
  368.  
  369.          write_flag = TRUE;
  370.  
  371.          while (write_flag)
  372.          {
  373.             if (wild_flag)
  374.             {
  375.                strcpy(src_file, source_path);
  376.                strlwr( dp->d_name );
  377.                strcat( strcpy(src_file, source_path), dp->d_name );
  378.                strcpy( src_file, normalize( src_file ));
  379.                printf("Queueing file %s for %s!%s\n", src_file, dest_syst,
  380.                         dest_file);
  381.             }
  382.             if (spool_flag)  {
  383.                sprintf(idfile , spool_fmt, 'D', E_nodename, (char) subseq++,
  384.                            sequence_s);
  385.                importpath(work, idfile, remote_syst);
  386.                mkfilename(idfilename, E_spooldir, work);
  387.                /* Do we need a MKDIR here for the system? */
  388.                if (cp(src_file, idfilename) != 0)  {
  389.                   printmsg(0, "copy \"%s\" to \"%s\" failed",
  390.                      src_file, idfilename);           /* copy data */
  391.                   closedir( dirp );
  392.                   exit(1);
  393.                }
  394.             }
  395.             else
  396.                strcpy(idfile, "D.0");
  397.             if ((cfile = FOPEN(icfilename, "a",TEXT_MODE)) == NULL)  {
  398.                printerr( icfilename );
  399.                printf("uucp: cannot append to %s\n", icfilename);
  400.                if (dirp != NULL )
  401.                   closedir( dirp );
  402.                exit(1);
  403.             }
  404.             fprintf(cfile, "S %s %s %s -%s %s 0666 %s\n", src_file, dest_file,
  405.                      E_mailbox, flags, idfile, remote_user);
  406.             fclose(cfile);
  407.             if (wild_flag)  {
  408.                dp = readdir(dirp);
  409.                if ( dp == NULL )
  410.                   write_flag = FALSE;
  411.             }
  412.             else
  413.                write_flag = FALSE;
  414.          }
  415.          if (dirp != NULL )
  416.             closedir( dirp );
  417.          return(1);
  418.       }
  419.       else  {
  420.          if (expand_path(src_file, NULL, E_homedir, NULL) == NULL)
  421.             exit(1);
  422.          if (expand_path(dest_file, NULL, E_homedir, NULL) == NULL)
  423.             exit(1);
  424.          if (strcmp(src_file, dest_file) == 0)
  425.          {
  426.             fprintf(stderr, "%s %s - same file; can't copy\n",
  427.                   src_file, dest_file);
  428.             exit(1);
  429.          }
  430.          cp(src_file, dest_file);
  431.          return(1);
  432.       }
  433. }
  434.  
  435. /*--------------------------------------------------------------------*/
  436. /*    m a i n                                                         */
  437. /*                                                                    */
  438. /*    main program, of course                                         */
  439. /*--------------------------------------------------------------------*/
  440.  
  441. void  main(int argc, char *argv[])
  442. {
  443.       int         i;
  444.       int         option;
  445.       boolean j_flag = FALSE;
  446.       char        src_system[100], dest_system[100];
  447.       char        src_inter[100],  dest_inter[100];
  448.       char        src_file[FILENAME_MAX],   dest_file[FILENAME_MAX];
  449.  
  450. /*--------------------------------------------------------------------*/
  451. /*                             Initialize                             */
  452. /*--------------------------------------------------------------------*/
  453.  
  454.       debuglevel = 0;
  455.  
  456.       banner( argv );
  457.       if (!configure(B_UUCP))
  458.          exit(1);
  459.  
  460. /*--------------------------------------------------------------------*/
  461. /*                        Process option flags                        */
  462. /*--------------------------------------------------------------------*/
  463.  
  464.       while ((option = getopt(argc, argv, "Ccdfg:jmn:rs:x:")) != EOF)  {
  465.          switch(option)  {
  466.             case 'c':               /* don't spool */
  467.                spool_flag = FALSE;
  468.                break;
  469.             case 'C':               /* force spool */
  470.                spool_flag = TRUE;
  471.                break;
  472.             case 'd':               /* make directories */
  473.                dir_flag = TRUE;
  474.                break;
  475.             case 'e':               /* send uucp command to sys */
  476.                /* This one is in Sams but nowhere else - I'm ignoring it */
  477.                break;
  478.             case 'f':               /* don't make directories */
  479.                dir_flag = FALSE;
  480.                break;
  481.             case 'g':               /* set grade of transfer */
  482.                grade = *optarg;
  483.                break;
  484.             case 'j':               /* output job id to stdout */
  485.                j_flag = TRUE;
  486.                break;
  487.             case 'm':               /* send mail when copy completed */
  488.                mail_me = TRUE;
  489.                break;
  490.             case 'n':               /* notify remote user file was sent */
  491.                mail_them = TRUE;
  492.                sprintf(remote_user, "%.8s", optarg);
  493.                break;
  494.             case 'r':               /* queue job only */
  495.                xeqt_flag = FALSE;
  496.                break;
  497.             case 's':               /* report status of transfer to file */
  498.                strcpy( spool_file, optarg);
  499.                expand_path( spool_file, NULL, E_pubdir , NULL);
  500.                break;
  501.             case 'x':               /* set debug level */
  502.                debuglevel = atoi(optarg);
  503.                break;
  504.             default:
  505.                usage();
  506.                exit(1);
  507.                break;
  508.          }
  509.       }
  510.       flags[0] = (char)(dir_flag ? 'd' : 'f');
  511.       flags[1] = (char)(spool_flag ? 'C' : 'c');
  512.       i = 2;
  513.       if (mail_them)
  514.          flags[i++] = 'n';
  515.       flags[i] = '\0';
  516.       if (remote_user[0] == '\0')
  517.          strcpy(remote_user, E_mailbox);
  518.       if (argc - optind < 2)  {
  519.          usage();
  520.          exit(1);
  521.       }
  522. /*--------------------------------------------------------------------*/
  523. /*       Now - posibilities:                                          */
  524. /*       Sources - 1 or more, local or 1 hop away (NOT > 1 hop!)      */
  525. /*       Dest    - normal cp rules, single only, local, 1 hop or >1   */
  526. /*                 hop                                                */
  527. /*       Wildcards possible on sources.                               */
  528. /*                                                                    */
  529. /*    Actions depend on these - so we need to split the pathnames     */
  530. /*    for more info.                                                  */
  531. /*--------------------------------------------------------------------*/
  532.  
  533.       split_path(argv[argc - 1], dest_system, dest_inter, dest_file);
  534.  
  535. /*--------------------------------------------------------------------*/
  536. /*        OK - we have a destination system - do we know him?         */
  537. /*--------------------------------------------------------------------*/
  538.  
  539.       if (*dest_system != '\0')  {
  540.          if (checkreal(dest_system) == BADHOST)  {
  541.             fprintf(stderr, "uucp - bad system: %s\n", dest_system);
  542.             exit(1);
  543.          }
  544.       }
  545.       else        /* make sure we have a system name for destination */
  546.          strcpy(dest_system, E_nodename);
  547.       printmsg(9, "destination: system \"%s\", inter \"%s\", file \"%s\"",
  548.             dest_system, dest_inter, dest_file);
  549.  
  550. /*--------------------------------------------------------------------*/
  551. /*    Now - if there is more than 1 source then normal cp rules,      */
  552. /*          i.e. dest must be a directory                             */
  553. /*--------------------------------------------------------------------*/
  554.  
  555.       if (argc - optind > 2)
  556.          strcat(dest_file, "/");
  557.       destn_file = argv[argc - 1];
  558.       for (i = optind; i < (argc - 1); i++)  {
  559.          split_path(argv[i], src_system, src_inter, src_file);
  560.  
  561. /*--------------------------------------------------------------------*/
  562. /*            We need to winnow out various combinations -            */
  563. /*                        so lets get at them                         */
  564. /*                                                                    */
  565. /*                   Do we know the source system?                    */
  566. /*--------------------------------------------------------------------*/
  567.  
  568.          if (*src_system != '\0')  {
  569.             if (checkreal(src_system) == BADHOST)  {
  570.                fprintf(stderr, "uucp - bad system %s\n", src_system);
  571.                exit(1);
  572.             }
  573.          }
  574.  
  575. /*--------------------------------------------------------------------*/
  576. /*                    Source can't be >1 hop away                     */
  577. /*--------------------------------------------------------------------*/
  578.  
  579.          if (*src_inter != '\0')  {
  580.             fprintf(stderr, "uucp - illegal syntax %s\n", argv[i]);
  581.             exit(1);
  582.          }
  583.  
  584. /*--------------------------------------------------------------------*/
  585. /*        if source is remote AND wildcarded then we need uux         */
  586. /*--------------------------------------------------------------------*/
  587.  
  588.          if ((*src_system != '\0') && (strcspn(src_file, "*?[") < strlen(src_file)))  {
  589.             do_uux(src_system, src_system, src_file, dest_system, dest_inter, dest_file);
  590.             continue;
  591.          }
  592.  
  593. /*--------------------------------------------------------------------*/
  594. /*            if dest requires forwarding then we need uux            */
  595. /*--------------------------------------------------------------------*/
  596.  
  597.          if (*dest_inter != '\0')  {
  598.             do_uux(dest_system, src_system, src_file, "", dest_inter, dest_file);
  599.             continue;
  600.          }
  601.  
  602. /*--------------------------------------------------------------------*/
  603. /*         if both source & dest are remote then we need uux          */
  604. /*--------------------------------------------------------------------*/
  605.  
  606.          if ((*src_system != '\0') && (!equal(src_system, E_nodename)) &&
  607.                (*dest_system != '\0') && (!equal(dest_system, E_nodename)))  {
  608.             do_uux(dest_system, src_system, src_file, "", dest_inter, dest_file);
  609.             continue;
  610.          }
  611. /*--------------------------------------------------------------------*/
  612. /*          We have left 3 options:                                   */
  613. /*          1) src remote (non-wild) & dest local                     */
  614. /*          2) src local & dest remote 1 hop                          */
  615. /*          3) src & dest both local                                  */
  616. /*                                                                    */
  617. /*               fill up the src system if not already                */
  618. /*--------------------------------------------------------------------*/
  619.          if (*src_system == '\0')
  620.             strcpy(src_system, E_nodename);
  621.          printmsg(4, "source: system \"%s\", file \"%s\"", src_system,
  622.                      src_file);
  623.          do_copy(src_system, src_file, dest_system, dest_file);
  624.       }
  625.       if (xeqt_flag)
  626.          printmsg(1, "Call uucico");
  627.       if (j_flag)
  628.          printmsg(1,"j_flag");
  629.       exit(0);
  630. }
  631.